If Bacterial Flagella is a tree, Basal Body is its root which affix them to Bacterial cell wall.
In gram positive, basal body is affixed to inner membrane, spans the peptidoglycan layer and gives rise to flagella
In gram negative, basal body is affixed to inner membrane, spans the peptidoglycan layer, is affixed again to outer membrane and gives rise to flagella.
!Pasted image 20220731201300.png